<template>
<block>
	<view class="">
		
<view class="my-001">
			<view class="my-content">
				<view class="toolmy-content">
					<view class="iconmy-content"></view>
					<view class="iconmy-content"></view>
					<view class="iconmy-content"></view>
				</view>
				<view class="usermy-content">
					<view class="avatarmy-content"></view>
					<view class="infomy-content">
						<view class="nickmy-content">石头</view>
						<view class="authmy-content">普通访客</view>
					</view>
				</view>
				<view class="toolsmy-content">
					<view class="itemmy-content">
						<view class="valuemy-content">0</view>
						<view class="labelmy-content">积分</view>
					</view>
					<view class="itemmy-content">
						<view class="valuemy-content">0</view>
						<view class="labelmy-content">余额</view>
					</view>
					<view class="itemmy-content">
						<view class="valuemy-content">0</view>
						<view class="labelmy-content">优惠券</view>
					</view>
				</view>
			</view>
		</view>
		<view class="my-section-001">
			<view class="title-barmy-section">
				<view class="namemy-section">我的订单</view>
				<!-- <a href="orders.html" class="moremy-section">全部订单</a> -->
				<navigator class="moremy-section" url="/pages/order/order-list/index" hover-class="none">
				  全部订单
				</navigator>
			</view>
			<view class="menumy-section">
				<a href="orders.html" class="itemmy-section">待付款</a>
				<a href="orders.html" class="itemmy-section">待发货</a>
				<a href="orders.html" class="itemmy-section">待收货</a>
				<a href="orders.html" class="itemmy-section">待评价</a>
				<a href="orders.html" class="itemmy-section">退换货</a>
			</view>
		</view>
		<view class="my-section-001">
			<view class="title-barmy-section">
				<view class="namemy-section">其他功能</view>
			</view>
			<view class="menumy-section">
				<a href="" class="itemmy-section">领券中心</a>
				<a href="" class="itemmy-section">积分商城</a>
				<a href="" class="itemmy-section">我的秒杀</a>
				<a href="" class="itemmy-section">我的拼团</a>
				<a href="" class="itemmy-section">客服中心</a>
			</view>
		</view>
		<view class="my-menu-001">
			<a href="" class="itemmy-menu">
				<view class="iconmy-menu"></view>
				<view class="namemy-menu">余额明细</view>
				<view class="arrowmy-menu"></view>
			</a>
			<a href="" class="itemmy-menu">
				<view class="iconmy-menu"></view>
				<view class="namemy-menu">积分明细</view>
				<view class="arrowmy-menu"></view>
			</a>
			<a href="" class="itemmy-menu">
				<view class="iconmy-menu"></view>
				<view class="namemy-menu">收货地址管理</view>
				<view class="arrowmy-menu"></view>
			</a>
			<a href="" class="itemmy-menu">
				<view class="iconmy-menu"></view>
				<view class="namemy-menu">联系我们</view>
				<view class="arrowmy-menu"></view>
			</a>
			<a href="" class="itemmy-menu">
				<view class="iconmy-menu"></view>
				<view class="namemy-menu">我的小店</view>
				<view class="arrowmy-menu"></view>
			</a>
		</view>
</view>


</block>
</template>

<script>
const app = getApp();
export default {
	data() {
        return {
		  config: app.globalData.config,
		  wxUser: null,
		  userInfo: null,
		  orderCountAll: []
		};
    },
	onShow() {
	  //更新tabbar购物车数量
	  uni.setTabBarBadge({
		index: 2,
		text: app.globalData.shoppingCartCount + ''
	  });
	  let wxUser = app.globalData.wxUser;
	  this.setData({
		wxUser: wxUser
	  });
	  this.wxUserGet();
	  this.orderCountAllFun();

	  // if (this.data.config.adEnable) {
	  if (this.config.adEnable) {
		// 在页面中定义插屏广告
		let interstitialAd = null; // 在页面onLoad回调事件中创建插屏广告实例

		if (uni.createInterstitialAd) {
		  interstitialAd = uni.createInterstitialAd({
			adUnitId: this.config.adInsertScreenID
		  });
		  interstitialAd.onLoad(() => {});
		  interstitialAd.onError(err => {});
		  interstitialAd.onClose(() => {});
		} // 在适合的场景显示插屏广告


		if (interstitialAd) {
		  interstitialAd.show().catch(err => {
			console.error(err);
		  });
		}
	  }
	}, 
	onLoad() {
	  this.onLoadClone3389();
	}, 
	methods: {
		onLoadClone3389() {},

		/**
		 * 小程序设置
		*/
		settings: function () {
		  uni.openSetting({
			success: function (res) {
			  console.log(res.authSetting);
			}
		  });
		},

		getUserProfile(e) {
		  uni.getUserProfile({
			desc: '用于完善会员资料',
			// 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
			success: detail => {
			  app.globalData.api.wxUserSave(detail).then(res => {
				let wxUser = res.data;
				this.setData({
				  wxUser: wxUser
				});
				app.globalData.wxUser = wxUser;
				this.wxUserGet();
			  });
			}
		  });
		},

		//获取商城用户信息
		wxUserGet() {
		  app.globalData.api.wxUserGet().then(res => {
			this.setData({
			  userInfo: res.data
			});
		  });
		},

		orderCountAllFun() {
		  app.globalData.api.orderCountAll().then(res => {
			this.setData({
			  orderCountAll: res.data
			});
		  });
		}
	}
};
</script>
<style >
/**index.wxss**/
page{
  background-color:#f3f4f7 !important;
}

.order-list{
  margin: auto;
  border-radius: 40rpx;
  background-color: white;
}

.order-list-2{
  background-image: linear-gradient(#fff, #f3f4f7);
}

.order-image{
  width: 80rpx;
  height: 80rpx;
}

.userinfo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.userinfo-avatar {
  width: 128rpx;
  height: 128rpx;
  margin: 20rpx;
  border-radius: 50%;
}

.userinfo-nickname {
  color: #aaa;
}

.usermotto {
  margin-top: 200px;
}

.address{
  margin-top: 60rpx !important;
}

.address-image{
  width: 100rpx;
  height: 100rpx;
}

.head {
  margin: auto;
  box-shadow: 0rpx 0rpx 50rpx 10rpx rgba(211, 211, 211, 0.5);
}

.titles-color{
  color:rgb(107, 107, 107);
}

.text-black{
  color: #000 !important;
}
</style>